import os.path
from typing import Literal


TimeFrameType = Literal["1s", "1m", "3m", "5m", "10m", "15m", "30m", "1h", "1d"]
SymbolType = Literal["coin", "stock"]

time_counts = {
    "1s": 1,
    "1m": 60,
    "3m": 3 * 60,
    "5m": 5 * 60,
    "10m": 10 * 60,
    "15m": 15 * 60,
    "30m": 30 * 60,
    "1h": 60 * 60,
    "1d": 24 * 60 * 60,
}

proxies = {
    "http": "http://127.0.0.1:7890",
    "https": "http://127.0.0.1:7890",
}

# proxies = {
#     "http": None,
#     "https": None,
# }

future_symbols = [
    "BTC/USDT:USDT",
    "ETH/USDT:USDT",
    # "SOL/USDT:USDT",
    # "DOGE/USDT:USDT",
    # "AGLD/USDT:USDT",
    # "HIVE/USDT:USDT",
    # "ATA/USDT:USDT",
    # "STEEM/USDT:USDT",
    # "GMT/USDT:USDT",
    # "ZEN/USDT:USDT",
    # "SUI/USDT:USDT",
    # "THE/USDT:USDT"
]
spot_symbols = [x[:-5] for x in future_symbols]
consider_symbols = future_symbols + spot_symbols

consider_bfnames = ["RVI_14", "Pascal_14"]


def get_datas_path():
    path = "./datas"
    if not os.path.exists(path):
        os.makedirs(path)
    return path


def get_duckdb_file(db_name: str):
    return f"{get_datas_path()}/{db_name}.duckdb"


def get_sqlalchemy_url(db_name: str):
    # return "mysql+pymysql://root:123456@127.0.0.1:3306/tradecoin"
    return f"duckdb:///{get_duckdb_file(db_name)}"


def get_kombu_url():
    return "sqla+sqlite:///kombu_database.sqlite"


def get_zmq_url():
    return "tcp://127.0.0.1:5555"
